home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 03 Pathfinding with Astar / 04 Higgins / Listing1.cpp next >
Encoding:
C/C++ Source or Header  |  2001-12-09  |  928 b   |  28 lines

  1. /* Copyright (C) Dan Higgins, 2001. 
  2.  * All rights reserved worldwide.
  3.  *
  4.  * This software is provided "as is" without express or implied
  5.  * warranties. You may freely copy and compile this source into
  6.  * applications you distribute provided that the copyright text
  7.  * below is included in the resulting source code, for example:
  8.  * "Portions Copyright (C) Dan Higgins, 2001"
  9.  */
  10.  
  11. // A Star Node
  12. struct AStarNode
  13. {
  14.     inline AStarNode(long inX = 0, long inY = 0)
  15.     : mX(inX),mY(inY),mTotalCost(0), mCostOfNode(0),
  16.       mCostToDestination(0),mParent(NULL),mNext(NULL),
  17.       mListParent(NULL) { }
  18.  
  19.     AStarNode* mParent;      // who opened me?
  20.     AStarNode* mNext;        // Next in my list
  21.     AStarNode* mListParent;  // my list Parent
  22.     long mTotalCost;         // f
  23.     long mCostOfNode;        // g
  24.     long mCostToDestination; // h (estimate)
  25.     long mX;                 // Tile X
  26.     long mY;                 // Tile Y
  27. };
  28.